package com.niit.controller

import com.niit.bean.Answer
import com.niit.handler.DataHandler
import com.niit.service.{EDUDataService, EDURecommendService}
import org.apache.spark.streaming.dstream.DStream

class EDUDataController {
  private val eduDataService = new EDUDataService
  private val eduRecommendService = new EDURecommendService
  def dispatch(): Unit ={
    val data: DStream[Answer] = DataHandler.kafkaAnswerDataHandler("BD2", "edu")
    //分析数据的业务 Service
    eduDataService.dataAnlysis(data)
    eduRecommendService.dataAnalysis(data)
    DataHandler.startAndAwait()
  }

}
